<template>
  <el-checkbox-group v-model="monitems1" size="small" @change="handlerChange">
    <el-checkbox
      v-for="(item,index) in allMonitems"
      :key="index"
      :label="item.id"
      border
      style="margin-top:20px"
    >{{item.name}}</el-checkbox>
  </el-checkbox-group>
</template>

<script>
export default {
  props: {
    monitems: {
      type: Array,
      default: () => []
    },
    sourceData: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      monitems1: this.monitems,
      allMonitems: [
        {
          id: '0000',
          name: '检测项目1'
        },
        {
          id: '0001',
          name: '检测项目2'
        },
        {
          id: '0002',
          name: '检测项目3'
        },
        {
          id: '0003',
          name: '检测项目4'
        }
      ]
    }
  },
  methods: {
    handlerChange () {
      this.$emit('update:monitems', this.monitems1)
    }
  }
}
</script>

<style scoped>
</style>
